package com.mutual.reins.danger.service.impl;

import com.mutual.reins.danger.entity.PrpcDangerDto;
import com.mutual.reins.danger.service.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * 实现危险单位接口
 * @author pc
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class PrpcDangerDtoServiceImpl implements IPrpcDangerDtoService {
    @Autowired
    private IPrpcDangerUnitService iPrpcDangerUnitService;
    @Autowired
    private IPrpcDangerItemService iPrpcDangerItemService;
    @Autowired
    private IPrpcDangerCoinsService iPrpcDangerCoinsService;
    @Autowired
    private IPrpcDangerPlanService iPrpcDangerPlanService;
    @Autowired
    private IPrpcDangerTotService iPrpcDangerTotService;

    /**
     * 保存危险单位对象
     *
     * @param prpcDangerDto 危险单位对象
     */
    @Override
    public void savePrpcDangerDtoList(PrpcDangerDto prpcDangerDto) {
        iPrpcDangerUnitService.saveBatch(prpcDangerDto.getPrpcDangerUnitDtoList());
        iPrpcDangerItemService.saveBatch(prpcDangerDto.getPrpcDangerItemDtoList());
        iPrpcDangerCoinsService.saveBatch(prpcDangerDto.getPrpcDangerCoinsDtoList());
        iPrpcDangerPlanService.saveBatch(prpcDangerDto.getPrpcDangerPlanDtoList());
        iPrpcDangerTotService.saveBatch(prpcDangerDto.getPrpcDangerTotDtoList());
    }
}
